﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using LM.Negocio.Objetos;

namespace LM.Repositorios.Maps
{
    public class EnderecoMap : EntityTypeConfiguration<Endereco>
    {
        public EnderecoMap()
        {
            this.HasKey(c => c.Id);
            this.Property(c => c.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity).HasColumnName("Id");
            
            this.Property(c => c.Codigo).HasColumnName("Codigo").IsRequired();
            this.Property(c => c.Logradouro).HasColumnName("Logradouro").IsRequired();
            this.Property(c => c.Numero).HasColumnName("Numero");
            this.Property(c => c.Lote).HasColumnName("Lote").IsRequired();
            this.Property(c => c.Quadra).HasColumnName("Quadra").IsRequired();
            this.Property(c => c.Bairro).HasColumnName("Bairro").IsRequired();
            this.Property(c => c.Complemento).HasColumnName("Complemento");
            this.Property(c => c.Cep).HasColumnName("Cep");
            this.Property(c => c.Cidade).HasColumnName("Cidade").IsRequired();
            this.Property(c => c.Uf).HasColumnName("Uf").IsRequired();

            this.ToTable("ENDERECO");
        }
    }
}
